﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.DirectoryServices.Protocols;
using System.Text;

namespace NP.BPMReportPlatform.Entities.BPM_Business.CommonReportConfigs
{
    /// <summary>
    /// 字段适配模块配置表
    /// </summary>
    public class CommonReportFieldConfig : CommonReportBase
    {
        /// <summary>
        /// 模块Id
        /// </summary>
        public string ModuleId { get; set; }

        /// <summary>
        /// 字段名
        /// </summary>
        public string FieldName { get; set; }

        /// <summary>
        /// 字段描述
        /// </summary>
        public string FieldDesc { get; set; }


        /// <summary>
        /// 下拉框选项（Json）、日期格式
        /// </summary>
        public string ShortSelectItemJson { get; set; }

        /// <summary>
        /// 输入框样式 字段类型 text=文本型，date=日期类型，用于设置搜索框，select-single=下拉框 单选，select-multiple 下拉框多选
        /// </summary>
        public string InputBoxType { get; set; }

        /// <summary>
        /// 表格列宽
        /// </summary>
        public string ColumnWidth { get; set; }

        /// <summary>
        /// 输入框宽度
        /// </summary>
        public string InputBoxWidth { get; set; }

        /// <summary>
        /// 输入框高度
        /// </summary>
        public string InputBoxHeight { get; set; }

        /// <summary>
        /// 是否可编辑
        /// </summary>
        public bool IsCanEdit { get; set; }

        /// <summary>
        /// 是否必填项
        /// </summary>
        public bool IsRequired { get; set; }

        /// <summary>
        /// 是否查询项
        /// </summary>
        public bool IsSearchItem { get; set; }

        /// <summary>
        /// 是否在显示
        /// </summary>
        public bool IsShow { get; set; }

        /// <summary>
        /// 是否可导出
        /// </summary>
        public bool IsCanExport { get; set; }

        /// <summary>
        /// 是否可导入
        /// </summary>
        public bool IsCanImport { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int ShowIndex { get; set; } = 0;

        /// <summary>
        /// 自定义SQL脚本-用于查询时候
        /// </summary>
        public string CustomScript { get; set; }

        /// <summary>
        /// 是否精确查询
        /// </summary>
        public bool IsAccurate { get; set; }

        /// <summary>
        /// 排序优先级
        /// </summary>
        public int OrderIndex { get; set; }

        /// <summary>
        /// 排序类型 DESC  ESC
        /// </summary>
        public string OrderType { get; set; }

        /// <summary>
        /// 校验类型 1 唯一
        /// </summary>
        public int? CheckType { get; set; }

        /// <summary>
        /// 校验
        /// </summary>
        public string RegexContent { get; set; }

        /// <summary>
        /// 校验失败提示信息
        /// </summary>
        public string CheckFailMessage { get; set; }

        /// <summary>
        /// 默认值类型 1.当前时间 2.当前用户Id 3.当前用户工号 4.当前用户名 5.Guid 1000.自定义
        /// </summary>
        public int? DefaultType { get; set; }

        /// <summary>
        /// 自定义默认值
        /// </summary>
        public string DefaultValue { get; set; }


        /// <summary>
        /// 字段值
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public object FieldValue { get; set; }

        [SugarColumn(IsIgnore = true)]
        public CommonReportField Field { get; set; }
    }
}
